#define quickread
#ifdef quickread
#include <cstdio> 
template <typename T>
inline void read(T& x)
{
    int c=getchar(), f=1; x=0;
    while(c<'0'||'9'<c) {if(c=='-') f=-1; c=getchar();}
    while('0'<=c&&c<='9') 
        x=(x<<3)+(x<<1)+c-'0', c=getchar();
    x*=f;
}
template <typename T>
inline void quickwrite(T x)
{
    if(x<0) putchar('-'), x*=-1;
    if(x>=10) quickwrite(x/10);
    putchar(x%10+'0');
}
#else 
#include <iostream>
#endif
#include <cstring>
#include <map>
using namespace std;
#define DEBUG
const int N=2e5+10;
int n, a[N];
int diff[N], ans[N]; //MEX可能值m对应的k的有效范围
//移除[L,R]个元素，m可以成为MEX
map<int, int> cnt;
void init()
{
    cnt.clear();
    memset(diff, 0, sizeof diff);
    memset(ans, 0, sizeof ans);
    read(n);
    for(int i=1; i<=n; i++) read(a[i]), cnt[a[i]]++;

    for(int i=0; i<=n; i++) //对所有有可能的取值进行预处理
    {
        diff[cnt[i]]++; //所有cnt[i]移除
        diff[n-i+1]--; //[0,m-1]各一个，需保留的最少个
        if(!cnt[i]) break;
    }
}

void solve()
{
    init();
    for(int k=0; k<=n; k++) 
    {
        ans[k]=(k?ans[k-1]:0)+diff[k];
        quickwrite(ans[k]); putchar(' ');
    }
    puts("");
}

// #undef DEBUG
signed main()
{
    #ifdef DEBUG
        freopen("../in.txt", "r", stdin);
        freopen("../out.txt", "w", stdout);
    #endif
    #ifndef quickread
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    #endif

    int T=1; scanf("%d", &T);
    while(T--) 
    {
        solve();
    }
    return 0;
}
